<template>
  <div class="Top">
    <img src="../msg/icon2.png" class="image">
    <h1 class="httpName">课堂行为检测</h1>
    <div class="Profile" @click="enterProfile">
      <span class="profile" id="Email">{{ email }}</span>
      <br>
      <span class="profile" id="TeacherName">{{ teacherName }}</span>
      <img class="Head" :src="Head">
    </div>
    <HomePage class="homePage" v-if="this.showHomePage" @blur="hideHomePage" />
  </div>
</template>

<script>
import HomePage from './HomePage.vue'

export default {
    name:'Top',
    components:{
        HomePage,
    },
    data(){
      return{
        showHomePage:false,
        Head:sessionStorage.getItem('Head')
      }
    },
    created(){
      console.log(sessionStorage.getItem('Email'));
    },
    computed:{
      email(){
        return sessionStorage.getItem('Email');
      },
      teacherName(){
        return sessionStorage.getItem('Name');
      },
    },
    methods:{
      enterProfile(){
        this.showHomePage=!this.showHomePage
        // this.$store.commit('updateShowHomePage',!this.showHomePage);
      },
      hideHomePage(){
        showHomePage=false;
      },
      changeHead(value){
        this.Head=value;
      },
    }
}
</script>

<style scoped>
.image{
  width: 50px;;
  position: relative;
  top: 8px;
  left: 20px;
}

.homePage{
    position: absolute;
    top:430%;
    left:85%;
    z-index: 100;
}
.httpName{
  font-size: 38px;
  letter-spacing: 5px; 
  font-weight: 1000;
  position: absolute;  
  top:-20px;
  left: 90px; 
  color: rgb(49, 45, 49);
}
.Profile{
    height:66px;
    width:250px;
    background-color: rgb(255, 255, 255);
    position: absolute;  
    top:0;
    right: 20px; 
    color: black; 
}

.profile[id='Email']{
  font-size: 13px;
  position: absolute;  
  top: 36px; 
  left: 79px;
}
.profile[id='TeacherName']{
  font-size: 16px;
  font-weight: 1000;
  position: absolute;  
  top: 12px;
  left: 79px;
}
.Head{
  height:46px;
  width:46px;
  border-radius: 23px;
  background-color: #eeb5eb;
  position: absolute;  
  top: 10px;
  left:25px;  
}
</style>